#ifndef __video_out_h
#define __video_out_h
#include <stdbool.h>
#include "oslib/osspriteop.h"
#include "oslib/wimp.h"
#ifndef __defs_h
#include "defs.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif

typedef struct dma_chain_desc dma_chain_desc;

struct dma_chain_desc
{
  unsigned nda;
  unsigned pad;
  unsigned puad;
  unsigned lad;
  unsigned bc;
  unsigned dc;

  dma_chain_desc *next;

  /* unused word appended so that all entries in
     descriptor array are 32-byte aligned as required */

  unsigned res1;
};

os_error *output_init(void);
os_error *output_fin(void);

os_error *output_get_screen_info(void);


os_error *get_addresses(byte *d, const byte *s,
                        dma_chain_desc **ppd, byte **pppd,
                        os_box *sr, os_box *dr,
                        size_t d_linelen,
                        size_t s_linelen,
                        bool do_source);
void release_dma_descs(dma_chain_desc **pd);

#ifdef __cplusplus
};
#endif
#endif
